package com.itany.corejava.code12_线程;

/**
 * @author MissChen
 * @version 1.0
 * @date 2023 年11月28日 17:08
 */
public class Test03_实现Runnable {
    public static void main(String[] args) {
        SomeThread2 st=new SomeThread2();
        Thread t1=new Thread(st);
        Thread t2=new Thread(st);

        t1.setName("t1");
        t2.setName("t2");

        t1.setPriority(10);//优先权，增大了概率
        t2.setPriority(1);
        //启动线程
        t1.start();

        t2.start();


    }
}
class SomeThread2 implements  Runnable{
    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName()+"正在执行");
    }
}